home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / role / roleplay.0-s / roleplay / RolePlaying-1.0 / scripts / PrintFunctions < prev    next >
Text File  |  1995-07-09  |  8KB  |  254 lines

  1. # Module: PrintFunctions
  2. # Tcl version: 7.3 (Tcl/Tk/XF)
  3. # Tk version: 3.6
  4. # XF version: $__lastrelease$
  5. #
  6.  
  7. # module contents
  8. global moduleList
  9. global autoLoadList
  10. set moduleList(PrintFunctions) { .top11 PrintFormCancel PrintFormHelp PrintFormPrint PrintFrame}
  11. set autoLoadList(PrintFunctions) {1}
  12.  
  13. # procedures to show toplevel windows
  14.  
  15.  
  16. # procedure to show window ShowWindow.top11
  17. proc ShowWindow.top11 { args} {
  18. # xf ignore me 7
  19.  
  20.   # build widget .top11
  21.   if {"[info procs XFEdit]" != ""} {
  22.     catch "XFDestroy .top11"
  23.   } {
  24.     catch "destroy .top11"
  25.   }
  26.   toplevel .top11 
  27.  
  28.   # Window manager configurations
  29.   global tkVersion
  30.   wm positionfrom .top11 ""
  31.   wm sizefrom .top11 ""
  32.   wm maxsize .top11 1000 768
  33.   wm minsize .top11 10 10
  34.   wm title .top11 {Printing Form}
  35.  
  36.  
  37.   # build widget .top11.frame34
  38.   frame .top11.frame34  -borderwidth {2}
  39.  
  40.   # build widget .top11.frame34.frame0
  41.   frame .top11.frame34.frame0  -borderwidth {2} -relief {raised}
  42.  
  43.   # build widget .top11.frame34.frame0.label1
  44.   label .top11.frame34.frame0.label1  -borderwidth {0} -text {Format}
  45.  
  46.   # build widget .top11.frame34.frame0.menubutton2
  47.   menubutton .top11.frame34.frame0.menubutton2  -bitmap {question} -menu {.top11.frame34.frame0.menubutton2.m} -text {}
  48.  
  49.   # build widget .top11.frame34.frame0.menubutton2.m
  50.   menu .top11.frame34.frame0.menubutton2.m 
  51.   .top11.frame34.frame0.menubutton2.m add command -command {OptionButtonSet .top11.frame34.frame0} -label {text}
  52.   .top11.frame34.frame0.menubutton2.m add command -command {OptionButtonSet .top11.frame34.frame0} -label {html}
  53.   .top11.frame34.frame0.menubutton2.m add command -command {OptionButtonSet .top11.frame34.frame0} -label {postscript}
  54.  
  55.   # build widget .top11.frame34.frame0.value
  56.   label .top11.frame34.frame0.value  -anchor {w} -relief {sunken} -text {text}
  57.  
  58.   # pack widget .top11.frame34.frame0
  59.   pack append .top11.frame34.frame0  .top11.frame34.frame0.label1 {left frame center fill}  .top11.frame34.frame0.value {left frame center expand fill}  .top11.frame34.frame0.menubutton2 {right frame center fill} 
  60.  
  61.   # build widget .top11.frame34.frame35
  62.   frame .top11.frame34.frame35  -borderwidth {2}
  63.  
  64.   # build widget .top11.frame34.frame35.radiobutton36
  65.   radiobutton .top11.frame34.frame35.radiobutton36  -text {Printer} -value {Printer} -variable {OutputDevice}
  66.  
  67.   # build widget .top11.frame34.frame35.radiobutton37
  68.   radiobutton .top11.frame34.frame35.radiobutton37  -text {File} -value {File} -variable {OutputDevice}
  69.  
  70.   # pack widget .top11.frame34.frame35
  71.   pack append .top11.frame34.frame35  .top11.frame34.frame35.radiobutton36 {left frame center expand}  .top11.frame34.frame35.radiobutton37 {right frame center expand} 
  72.  
  73.   # build widget .top11.frame34.frame38
  74.   frame .top11.frame34.frame38  -borderwidth {2}
  75.  
  76.   # build widget .top11.frame34.frame38.frame39
  77.   frame .top11.frame34.frame38.frame39  -borderwidth {2}
  78.  
  79.   # build widget .top11.frame34.frame38.frame39.entry42
  80.   entry .top11.frame34.frame38.frame39.entry42  -relief {sunken}
  81.  
  82.   # build widget .top11.frame34.frame38.frame39.label41
  83.   label .top11.frame34.frame38.frame39.label41  -text {Printer Command:}
  84.  
  85.   # pack widget .top11.frame34.frame38.frame39
  86.   pack append .top11.frame34.frame38.frame39  .top11.frame34.frame38.frame39.label41 {left frame center}  .top11.frame34.frame38.frame39.entry42 {right frame center} 
  87.  
  88.   # build widget .top11.frame34.frame38.frame40
  89.   frame .top11.frame34.frame38.frame40  -borderwidth {2}
  90.  
  91.   # build widget .top11.frame34.frame38.frame40.button45
  92.   button .top11.frame34.frame38.frame40.button45  -command {
  93.   global fsBox
  94.   set fsBox(showPixmap) 0
  95.   set newfile [FSBox "Filename:" "print.text"]
  96.   if {$newfile != {}} {
  97.     [SN PrintFormFilename] delete 0 end
  98.     [SN PrintFormFilename] insert end $newfile
  99.   }} -text {Browse}
  100.  
  101.   # build widget .top11.frame34.frame38.frame40.entry44
  102.   entry .top11.frame34.frame38.frame40.entry44  -relief {sunken}
  103.  
  104.   # build widget .top11.frame34.frame38.frame40.label43
  105.   label .top11.frame34.frame38.frame40.label43  -text {Filename:}
  106.  
  107.   # pack widget .top11.frame34.frame38.frame40
  108.   pack append .top11.frame34.frame38.frame40  .top11.frame34.frame38.frame40.label43 {left frame center}  .top11.frame34.frame38.frame40.entry44 {left frame center}  .top11.frame34.frame38.frame40.button45 {right frame center} 
  109.  
  110.   # pack widget .top11.frame34.frame38
  111.   pack append .top11.frame34.frame38  .top11.frame34.frame38.frame39 {top frame center fillx}  .top11.frame34.frame38.frame40 {top frame center fillx} 
  112.  
  113.   # pack widget .top11.frame34
  114.   pack append .top11.frame34  .top11.frame34.frame35 {top frame center fillx}  .top11.frame34.frame38 {top frame center fillx}  .top11.frame34.frame0 {top frame center fillx} 
  115.  
  116.   # build widget .top11.frame46
  117.   frame .top11.frame46  -borderwidth {2}
  118.  
  119.   # build widget .top11.frame46.button47
  120.   button .top11.frame46.button47  -command {PrintFormPrint} -text {Print}
  121.  
  122.   # build widget .top11.frame46.button48
  123.   button .top11.frame46.button48  -command {PrintFormCancel} -text {Cancel}
  124.  
  125.   # build widget .top11.frame46.button49
  126.   button .top11.frame46.button49  -command {PrintFormHelp} -text {Help}
  127.  
  128.   # pack widget .top11.frame46
  129.   pack append .top11.frame46  .top11.frame46.button47 {left frame center expand}  .top11.frame46.button48 {left frame center expand}  .top11.frame46.button49 {right frame center expand} 
  130.  
  131.   # build widget .top11.label33
  132.   label .top11.label33  -font {-Adobe-Helvetica-Bold-R-Normal--*-240-*} -text {Printing A Form}
  133.  
  134.   # pack widget .top11
  135.   pack append .top11  .top11.label33 {top frame center}  .top11.frame34 {top frame center expand fillx}  .top11.frame46 {top frame center fillx} 
  136.  
  137.   if {"[info procs XFEdit]" != ""} {
  138.     XFEditSetShowWindows
  139.     XFMiscBindWidgetTree .top11
  140.   }
  141.  
  142.   .top11.frame34.frame38.frame39.entry42 insert end {|lpr}
  143.   .top11.frame34.frame38.frame40.entry44 insert end {print.text}
  144. }
  145.  
  146. proc DestroyWindow.top11 {} {# xf ignore me 7
  147.   if {"[info procs XFEdit]" != ""} {
  148.     if {"[info commands .top11]" != ""} {
  149.       global xfShowWindow.top11
  150.       set xfShowWindow.top11 0
  151.       XFEditSetPath .
  152.       after 200 "XFSaveAsProc .top11; XFEditSetShowWindows"
  153.     }
  154.   } {
  155.     catch "destroy .top11"
  156.     update
  157.   }
  158. }
  159.  
  160.  
  161. # User defined procedures
  162.  
  163.  
  164. # Procedure: PrintFormCancel
  165. proc PrintFormCancel {} {
  166.   DestroyWindow[SN PrintForm]
  167. }
  168.  
  169.  
  170. # Procedure: PrintFormHelp
  171. proc PrintFormHelp {} {
  172.   PopupHelpTopic PrintForm
  173. }
  174.  
  175.  
  176. # Procedure: PrintFormPrint
  177. proc PrintFormPrint {} {
  178.   set filename [[SN PrintFormFilename] get]
  179.   set printer  [[SN PrintFormPrinter] get]
  180.   set mode     [lindex [[SN PrintFormMode] configure -text] 4]
  181.   DestroyWindow[SN PrintForm]
  182.   global OutputDevice
  183.   global CurrentFrame
  184.   case $CurrentFrame in {
  185.     {CharacterFrame} {
  186.       global CurrentCharacter
  187.       if {$CurrentCharacter(handle) != {}} {
  188.     case $OutputDevice in {
  189.       {Printer} {
  190.         $CurrentCharacter(handle) print $printer $mode
  191.       }
  192.       {File} {
  193.         $CurrentCharacter(handle) print $filename $mode
  194.       }
  195.     }
  196.       }
  197.     }
  198.     {MonsterFrame} {
  199.       global CurrentMonster
  200.       if {$CurrentMonster(handle) != {}} {
  201.     case $OutputDevice in {
  202.       {Printer} {
  203.         $CurrentMonster(handle) print $printer $mode
  204.       }
  205.       {File} {
  206.         $CurrentMonster(handle) print $filename $mode
  207.       }
  208.     }
  209.       }
  210.     }
  211.     {MasterFrame} {
  212.       global MasterMode
  213.       global CurrentMasterDungeon
  214.       global CurrentMasterGame
  215.       if {$MasterMode == "Build"} {
  216.     if {$CurrentMasterDungeon(handle) != {}} {
  217.       case $OutputDevice in {
  218.         {Printer} {
  219.           $CurrentMasterDungeon(handle) print $printer $mode
  220.         }
  221.         {File} {
  222.           $CurrentMasterDungeon(handle) print $filename $mode
  223.         }
  224.       }
  225.     }
  226.       } else {
  227.         if {$CurrentMasterGame(handle) != {}} {
  228.       case $OutputDevice in {
  229.         {Printer} {
  230.           $CurrentMasterGame(handle) print $printer $mode
  231.         }
  232.         {File} {
  233.           $CurrentMasterGame(handle) print $filename $mode
  234.         }
  235.       }
  236.     }
  237.       }
  238.     }
  239.   }
  240. }
  241.  
  242.  
  243. # Procedure: PrintFrame
  244. proc PrintFrame {} {
  245.   ShowWindow[SN PrintForm]
  246. }
  247.  
  248.  
  249. # Internal procedures
  250.  
  251. # eof
  252. #
  253.  
  254.